<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE>Administrator's Control Panel</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="{PUB}admin/style.css" type=text/css rel=stylesheet>
<script type="text/javascript" src="{PUB}js/jquery.min.js"></script>
<script type="text/javascript" src="{PUB}js/dialog.js"></script>
<META content="MSHTML 6.00.2900.3157" name=GENERATOR></HEAD>
<BODY id="main">
<h2>添加海报/剧照/壁纸</h2>
<link type="text/css" href="{PUB}js/uploadify/uploadify.css"  rel="stylesheet" />
<script type="text/javascript" src="{PUB}js/uploadify/swfobject.js"></script>
<script type="text/javascript" src="{PUB}js/uploadify/jquery.uploadify.v2.1.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	$('#file_upload').uploadify({
		'uploader'  : '{PUB}js/uploadify/uploadify.swf',
		'script'    : '{admin}moviepic/upload/{id}/',
		'cancelImg' : '{PUB}js/uploadify/cancel.png',		
		'buttonImg'	: '{PUB}js/uploadify/file_btn.png',
		'multi'		: true,
		'auto'      : true,
		'queueSizeLimit'	: '10',
		//'sizeLimit'	: '20480',		
		//'fileDesc'  : '请选择JPG、PNG、GIF格式文件',
		//'fileExt'   : '*.jpg;*.png;*.gif' ,
		'height'	: '39',
		'width'		: '134',
		'displayData' : 'speed',
		'onError'	: function(event,queueID,fileObj,errorObj){   
			if (errorObj.status == 404){   
				alert('找不到文件');   
			}else if (errorObj.type === "HTTP"){   
				alert('error '+errorObj.type+": "+errorObj.status);   
			}else if (errorObj.type ==="File Size"){   
				alert('文件太大。');   
			}else{   
				alert('error '+errorObj.type+": "+errorObj.text);   
			}
		},
		 'onQueueFull'    : function (event,queueSizeLimit) {
			alert("对不起,每次最多可以上传十张图片。");
			 return false;
		},
		'onAllComplete' : function (event,data) {
			window.location.href = "{admin}moviepic/{id}";
		}

	});
});
</script>
<div class="message" style="width:380px;padding:10px;height:20px;margin:0px">每次最多可以上传十张图片，按着ctrl或shift一次选择多张</div>
<div class="clear"></div>
<div class="bd">
	<ul class="pic-col5" id="upimg"></ul>
</div>
<div id="upload_file">
		<form action="/photos/editphotos/{id}" method="post" id="upload" enctype="multipart/form-data"><br>
		<span id="filebtn"><input id="file_upload" name="file_upload" type="file"/><br></span>
			<input type="submit" class="btn" id="editbtn" style="display:none" value="编辑图片信息">
			<div id="result"></div>
		</form>
</div>

<h2>{title} 图片列表</h2>
<script type="text/javascript">
function edit(id) {
	$.fn.jmodal({
		title: '修改 {title} 图片标题',
		content: function(e) {
			e.html('loading...');
			e.load('{admin}moviepic/edit/'+id);
		},
		okEvent: function(obj, args) {
			args.complete();
		}
	});
	return false;
}
function editaction (id) {
	$.ajax({url: '{admin}moviepic/edit/'+id,
		type: 'POST',
		data:{
			title:$('#title').val(),
			id:id
		},
		dataType: 'html',
		error: function(){
			alert('System Error !');
		},
		success: function(result){
			$.fn.hideJmodal();			
		}
	});
}
</script>
<FORM name="upload" method="POST" action="" >
<DIV class="imgBox">
	<UL>
<!-- BEGIN list -->
	  <LI><div class="content"><a href="{PUB}upload/photos/{filename}" style="background:none"><img src="{PUB}upload/photos/thumb/{filename}"></a></div>
	  <DIV class="name"><a href="javascript:;" onclick="edit({id});" class="del">修改</a> | <a href="{admin}moviepic/del/{id}" class="del" onclick="return confirm('确定要删除？此操作不可撤销！');">删除</a></DIV>
	  </LI>	  
<!-- END list -->
	</UL>
	<DIV class=clear></DIV>
</DIV>
</form>
{pageParam}
<br>
</BODY></HTML>
